# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        Young  
# Name:         demo12.12
# Description:
# Author:       $赵怡蕾
# Date:         2019/3/19
#-------------------------------------------------------------------------------

import time
# 获取当前的时间截
time1 = time.time()
# 当前时间截往后移1分钟
time2 = time1 + 60
# 当前时间截往后移1小时
time3 = time1 + 60 * 60
# 当前时间截往后移一天
time4 = time1 + 60 * 60 * 24
# 下面4行代码将时间截转换为时间元组
time1 = time.localtime(time1)
time2 = time.localtime(time2)
time3 = time.localtime(time3)
time4 = time.localtime(time4)
# 下面4行代码分别输出了前面4个时间元组格式化后的日期和时间
print(time.strftime("%Y-%m-%d %H:%M:%S",time1))
print(time.strftime("%Y-%m-%d %H:%M:%S",time2))
print(time.strftime("%Y-%m-%d %H:%M:%S",time3))
print(time.strftime("%Y-%m-%d %H:%M:%S",time4))